"""
Author: wenbin
Create: 2024-09-01
"""
import uuid

from sqlalchemy import Column, String, UUID, Index

from .base_model import BaseModel


class Account(BaseModel):
    """账号模型"""

    __tablename__ = "account"
    __table_args__ = (
        Index("idx_account_email", "email"),
        {"comment": "账号表"}
    )

    id = Column(UUID, default=uuid.uuid4, primary_key=True, comment="id")
    nickname = Column(String(50), nullable=False, comment="昵称")
    avatar = Column(String(255), nullable=False, comment="头像")
    email = Column(String(50), unique=True, comment="邮箱")
    password = Column(String(255), nullable=False, comment="密码")
